import type { RouteRecordRaw } from 'vue-router';
import { t } from '@/hooks/useI18n';

const moduleName = 'library';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/library',
    redirect: '/library/material',
    meta: {
      title: '供应商',
      hideInMenu: true,
    },
    children: [
      {
        path: 'material',
        name: `${moduleName}-material`,
        component: () => import('@/views/library/material.vue'),
        meta: { title: t('routes.library.material'), hideInMenu: false },
      },
      {
        path: 'supplier',
        name: `${moduleName}-supplier`,
        component: () => import('@/views/library/supplier.vue'),
        meta: { title: t('routes.library.supplier'), hideInMenu: false },
      },
    ],
  },
];

export default routes;
